import EventDefines from "../Constants/EventDefines";

/**
 * 带点击响应的item
 * created by Five on 2018-11-6 18:07:59
 */

export default class ClickItem extends cc.Component {

    public DataStruct: any;

    constructor() {
        super();
    }

    public SetData(d: any) {
        this.DataStruct = d;
    }

    start() {
        this.node.on(cc.Node.EventType.TOUCH_START, (e:cc.Event.EventTouch) => {
            e.stopPropagation();
            this.node.dispatchEvent(new cc.Event(EventDefines.ENTITY_CLICKED, true));
        }, this);
    }
}